<div class="layui-form" lay-filter="layuiadmin-form-useradmin" style="padding: 20px 0 0 0;">
    <div class="layui-form-item">
        <label class="layui-form-label" style="width: 85px">税务人员代码</label>
        <div class="layui-input-inline">
            <script type="text/html" template>
                <input type="text" name="userId" value="{{ d.params.userId || '' }}" lay-verify="required|isExist"
                       placeholder="请输入税务人员代码" autocomplete="off" class="layui-input">
            </script>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label" style="width: 85px">税务人员名称</label>
        <div class="layui-input-inline">
            <script type="text/html" template>
                <input type="text" name="userName" value="{{ d.params.userName || '' }}" lay-verify="required|isExist"
                       placeholder="请输入税务人员名称" autocomplete="off" class="layui-input">
            </script>
        </div>
    </div>
<!--    <div class="layui-form-item">-->
<!--        <label class="layui-form-label" style="width: 85px">密码</label>-->
<!--        <div class="layui-input-inline">-->
<!--            <script type="text/html" template>-->
<!--                <input id="password" type="password" name="password" value="{{ d.params.password || '' }}"-->
<!--                       lay-verify="required"-->
<!--                       placeholder="请输入密码" autocomplete="off" class="layui-input">-->
<!--                &lt;!&ndash;在输入框后接img标签&ndash;&gt;-->
<!--                &lt;!&ndash;                <img id="img" onclick="hideShowPsw()"&ndash;&gt;-->
<!--                &lt;!&ndash;                     src="{{ layui.setter.base }}style/res/template/passwordImg/close.png">&ndash;&gt;-->
<!--            </script>-->
<!--        </div>-->
<!--    </div>-->

    <div class="layui-form-item">
        <label class="layui-form-label" style="width: 85px">角色名称</label>
        <script type="text/html" template>
            <div class="layui-input-block" id="checkboxdata">
                {{# console.log('>>>>>>>>>>>>>>' + JSON.stringify(d.params))}}
                {{# if(d.params.roleNames){ }}
                {{# layui.each(layui.data('test').roles,function(index,item){ }}
                <input type='checkbox' name={{item.roleId}} title={{item.roleName}} {{
                       (d.params.roleNames.indexOf(item.roleName) !=-1 ? 'checked' :
                '') }}>
                {{# }); }}
                {{#}else{ }}
                {{# layui.each(layui.data('test').roles,function(index,item){ }}
                <input type='checkbox' name={{item.roleId}} title={{item.roleName}}>
                {{# }); }}
                {{# } }}
            </div>
        </script>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label" style="width: 80px">岗位名称</label>
        <script type="text/html" template>
            <div class="layui-input-block">
                <select name="gw" lay-verify="required" lay-search>
                    <option value=""></option>
                    {{# if(d.params.gwName){ }}
                    {{# layui.each(layui.data('test').posts,function(index,item){ console.log("编辑==" +
                    JSON.stringify(d.params) + "===" + JSON.stringify(item)) }}
                    <option value={{item.GWDM}} {{ (d.params.gwName=== item.GWMC ?
                    'selected' : '') }}>{{item.GWMC}}</option>
                    {{# }); }}
                    {{#}else{ }}
                    {{# layui.each(layui.data('test').posts,function(index,item){ console.log("添加==" +
                    JSON.stringify(item)) }}
                    <option value={{item.GWDM}}>{{item.GWMC}}</option>
                    {{# }); }}
                    {{# } }}
                </select>
            </div>
        </script>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label" style="width: 85px">手机号码</label>
        <div class="layui-input-inline">
            <script type="text/html" template>
                <input type="text" name="phone" value="{{ d.params.phone || '' }}"
                       placeholder="请输入号码" autocomplete="off" class="layui-input">
            </script>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label" style="width: 85px">邮箱地址</label>
        <div class="layui-input-inline">
            <script type="text/html" template>
                <input type="text" name="email" value="{{ d.params.email || '' }}"
                       placeholder="请输入邮箱" autocomplete="off" class="layui-input">
            </script>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label" >描述信息</label>
        <div class="layui-input-block">
            <script type="text/html" template>
                <textarea type="text" name="desc" autocomplete="off"
                          class="layui-textarea">{{ d.params.desc || '' }}</textarea>
            </script>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label"></label>
        <div class="layui-input-inline">
            <input type="button" lay-submit lay-filter="LAY-user-front-submit" value="确认" class="layui-btn mybtn">
        </div>
    </div>
</div>

<script>
    // var PWD = $('#password')
    // console.log(PWD.attr('type'))
    // var demoImg = $('#img')
    // var PWD = $("input[name='password']")
    // console.log(PWD.attr('type'))
    // function hideShowPsw() {
    //     if (PWD.attr('type') == "password") {
    //         console.log(1)
    //         PWD.attr('type','text')
    //         demoImg.attr("src", "../src/style/res/template/passwordImg/close.png"); //图片路径（闭眼图片）
    //     } else {
    //         console.log(2)
    //         PWD.attr('type','password')
    //         demoImg.attr("src", "../src/style/res/template/passwordImg/open.png"); // 图片路径（睁眼图片）
    //
    //     }
    // }
    // $(".layui-form-label").css({"width": "85px"});
    layui.use(['form'], function () {
        // $('#img').click(function () {
        //
        // })

        // form.render()

        // form.verify({
        //     isExist: function (value) {
        //         var params = $('.layui-input-inline input[name="username"]').val();
        //         debugger
        //         var data;
        //         $.ajax({
        //             url: 'http://172.20.10.12:8000/post/',
        //             beforeSend: function (XMLHttpRequest) {
        //                 XMLHttpRequest.setRequestHeader("Authorization", layui.data('layuiAdmin', 'Authorization'));
        //             },
        //             contentType: "application/json",
        //             dataType: 'json',
        //             type: "post",
        //             async: false,
        //             data: JSON.stringify({"name": params}),
        //             success: function (result) {
        //                 data = result
        //             },
        //         });
        //         if (data.code === 0) {
        //             return '用户id已存在';
        //         }
        //
        //     }
        //
        // })
    })
</script>